<?php
/** @var MailPlantillaController $this */
/** @var MailPlantilla $model */
/** @var AweActiveForm $form */
$form = $this->beginWidget('ext.AweCrud.components.AweActiveForm', array(
    'type' => 'vertical',
    'id' => 'mail-plantilla-form',
    'enableAjaxValidation' => true,
    'clientOptions' => array('validateOnSubmit' => false, 'validateOnChange' => true,),
    'enableClientValidation' => false,
        ));
?>
<p class="note"><?php echo Yii::t('AweCrud.app', 'Fields with') ?> <span class="required">*</span> <?php echo Yii::t('AweCrud.app', 'are required') ?>.</p>
<?php echo $form->textFieldRow($model, 'nombre', array('maxlength' => 64)); ?>
<div class="control-group">
    <?php echo $form->labelEx($model, 'mensaje'); ?>
    <div class="controls">
        <?php
        $this->widget('bootstrap.widgets.TbRedactorJs', array(
            'model' => $model,
            'attribute' => 'mensaje',
            'editorOptions' => array(
                'lang' => 'es',
                'iframe' => true,
            ),
            'height' => '200px'
        ));
        ?>
    </div>
</div>
<div class="control-group ">
    <label class="control-label" for="MailAsuntos"><?php echo Yii::t('app', 'Asuntos de mail'); ?></label>
    <div class="controls form-check-list">
        <?php echo CHtml::checkBoxList('MailPlantilla[mailAsuntos]', array_map('AweHtml::getPrimaryKey', $model->mailAsuntos), CHtml::listData(MailAsunto::model()->activos()->findAll(), 'id', 'nombre'), array('attributeitem' => 'id', 'checkAll' => 'Seleccionar todos'))
        ?>
    </div>
</div>

<div class="form-actions">
    <?php
    $this->widget('bootstrap.widgets.TbButton', array(
        'buttonType' => 'submit',
        'icon' => 'ok',
        'type' => 'success',
        'label' => $model->isNewRecord ? Yii::t('AweCrud.app', 'Create') : Yii::t('AweCrud.app', 'Save'),
    ));
    ?>
    <?php
    $this->widget('bootstrap.widgets.TbButton', array(
        'label' => Yii::t('AweCrud.app', 'Cancel'),
        'icon' => 'remove',
        'htmlOptions' => array('onclick' => 'javascript:history.go(-1)')
    ));
    ?>
</div>

<?php $this->endWidget(); ?>